home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / games / nhak_src.zip / MAKEFILE.ST < prev    next >
Text File  |  1993-03-16  |  10KB  |  330 lines

  1. #    SCCS Id: @(#)Makefile.st    3.0    90/01/14
  2. #    ST NetHack 3.0 Makefile for GCC 1.34 or higher
  3. #
  4. #    NOTE: There's a bug in the GCC 1.35 (and maybe 1.34) that
  5. #    requires the omission of the -O flag on a couple of files;
  6. #    see the comments further down.
  7. #
  8. #    Also: There's one really awful kludge here: I had to break
  9. #    monst.o up into two pieces to get it to compile on my machine
  10. #    (a Mega 2). You'll need "sed" to get this to work.
  11. #    If you have 2.5 megs or more, you can probably delete the
  12. #    strange dependency lines for monst.o and just compile
  13. #    it directly.
  14. #
  15. CC    = d:\gnu\bin\gcc.ttp
  16. LD    = d:\gnu\bin\gcc-ld.ttp
  17. YACC    = d:\gnu\bin\bison.ttp -y
  18. LEX    = d:\gnu\bin\flex.ttp
  19. #
  20. # for 32 bit integers (slow, but type mismatches are no problem)
  21. # MODEL    =
  22. # TERMCAP = -lcurses
  23. #
  24. # for 16 bit integers (faster, but more finicky)
  25. MODEL    = -mshort
  26. TERMCAP = -lcurses16
  27.  
  28. # Directories (makedefs hardcodes these, don't change them)
  29. INCL    = ..\include
  30. AUX    = ..\auxil
  31. SRC    = ..\src
  32.  
  33. #
  34. # Use the following line for maximum warnings
  35. WARN=-D__GNULINT__ -W -Wimplicit -Wreturn-type -Wunused -Wpointer-arith \
  36.  -Wcast-qual -Wwrite-strings
  37. #
  38. # WARN =
  39. #
  40. CFLAGS = $(MODEL) -O -fomit-frame-pointer $(WARN) -I..\include
  41. LFLAGS    = $(MODEL) -s
  42. TARG    = tos
  43. PC    = pc
  44.  
  45. # Optional high-quality BSD random number generation routines (see tosconf.h).
  46. # Set to nothing if not used.
  47. RANDOM = random.o
  48.  
  49. # The game name
  50. GAME= nethack
  51.  
  52. # The game directory
  53. GAMEDIR = \games\$(GAME)
  54.  
  55. # The game filename
  56. GAMEFILE = $(GAMEDIR)\$(GAME).ttp
  57.  
  58. # object files for makedefs
  59. MAKEOBJS = makedefs.o monst.o objects.o
  60.  
  61. # object files for special levels compiler
  62. SPLEVOBJS = lev_comp.o lev_lex.o lev_main.o alloc.o monst.o objects.o panic.o
  63.  
  64. # nothing below this line should have to be changed
  65. #
  66. # other things that have to be reconfigured are in config.h,
  67. # {unixconf.h, pcconf.h, tosconf.h}, and possibly system.h
  68.  
  69. VOBJ = allmain.o alloc.o apply.o artifact.o attrib.o bones.o cmd.o \
  70.     dbridge.o decl.o \
  71.     demon.o do.o do_name.o do_wear.o dog.o dogmove.o dokick.o dothrow.o \
  72.      eat.o end.o engrave.o exper.o extralev.o fountain.o getline.o hack.o \
  73.     invent.o lock.o main.o makemon.o mcastu.o mhitm.o \
  74.     mhitu.o mklev.o mkmaze.o mkobj.o mkroom.o mon.o mondata.o monmove.o \
  75.     monst.o  mthrowu.o msdos.o music.o o_init.o objects.o \
  76.     objnam.o options.o pager.o \
  77.     pickup.o polyself.o potion.o pray.o pri.o priest.o prisym.o read.o \
  78.     restore.o rip.o rnd.o rumors.o save.o search.o shk.o shknam.o sit.o \
  79.     sounds.o sp_lev.o spell.o steal.o termcap.o timeout.o topl.o topten.o \
  80.     track.o trap.o tty.o u_init.o uhitm.o unix.o vault.o \
  81.     weapon.o were.o wield.o wizard.o worm.o worn.o write.o zap.o $(RANDOM)
  82.  
  83. HOBJ =    $(VOBJ) version.o
  84.  
  85. PCCONF_H   = $(INCL)\$(TARG)conf.h $(INCL)\msdos.h $(INCL)\system.h \
  86.          $(INCL)\extern.h 
  87. GLOBAL_H   = $(INCL)\global.h $(INCL)\coord.h $(PCCONF_H)
  88. CONFIG_H   = $(INCL)\config.h $(INCL)\tradstdc.h $(GLOBAL_H)
  89. TRAP_H       = $(INCL)\trap.h
  90. PERMONST_H = $(INCL)\permonst.h $(INCL)\monattk.h $(INCL)\monflag.h
  91. YOU_H       = $(INCL)\you.h $(INCL)\attrib.h $(PERMONST_H) $(INCL)\mondata.h \
  92.          $(INCL)\monst.h $(INCL)\youprop.h $(INCL)\prop.h $(INCL)\pm.h
  93. DECL_H       = $(INCL)\decl.h $(INCL)\spell.h $(INCL)\obj.h $(YOU_H) \
  94.          $(INCL)\onames.h $(INCL)\pm.h $(INCL)\color.h
  95. HACK_H       = $(CONFIG_H) $(DECL_H) $(INCL)\monsym.h $(INCL)\mkroom.h \
  96.          $(INCL)\objclass.h $(INCL)\gold.h $(INCL)\trap.h $(INCL)\flag.h \
  97.          $(INCL)\rm.h $(INCL)\hack.h
  98.  
  99. # The main target
  100. $(GAME).ttp: $(HOBJ)
  101.     $(CC) -o $(GAME).ttp $(LFLAGS) $(HOBJ) $(TERMCAP)
  102.  
  103. $(GAME): $(GAME).ttp
  104.  
  105. all:    $(GAME) lev_comp.ttp auxil
  106.     @echo Done.
  107.  
  108. makedefs.ttp:    $(MAKEOBJS)
  109.     $(CC) $(LFLAGS) -o makedefs.ttp $(MAKEOBJS)
  110.  
  111. makedefs.o:  $(INCL)\config.h $(INCL)\permonst.h $(INCL)\objclass.h
  112.  
  113. lev_comp.ttp:  $(SPLEVOBJS)
  114.     $(CC) $(LFLAGS) -o lev_comp.ttp $(SPLEVOBJS)
  115.  
  116. lev_comp.o:  $(HACK_H) $(INCL)\sp_lev.h
  117. lev_lex.o:  $(INCL)\lev_comp.h $(HACK_H) $(INCL)\sp_lev.h
  118. lev_main.o:  $(HACK_H)
  119.  
  120. # If you have yacc or lex programs, and make any changes,
  121. # you'll need rules like these. The names of the output
  122. # files (e.g. lex,yy.c) vary widely among different ST implementations
  123. # of YACC and LEX.
  124. #
  125. # Also: for some reason the supplied lev_lex.c causes the GCC to abort
  126. # on my machine (maybe not enough memory?) when compiled with -mshort.
  127. # With MODEL=-mshort, I had to use the lev_lex.c from others.
  128. #
  129. lev_comp.c:  lev_comp.y
  130.     $(YACC) -d lev_comp.y
  131.     cp y,tab.c lev_comp.c
  132.     cp y,tab.h ..\include\lev_comp.h
  133.     rm y,tab.c y,tab.h
  134.  
  135. lev_lex.c:  lev_comp.l
  136.     $(LEX) lev_comp.l
  137.     cp lex,yy.c lev_lex.c
  138.     rm lex,yy.c
  139. #
  140. #    The following include files depend on makedefs to be created.
  141. #
  142. #    date.h should be remade any time any of the source or include code
  143. #    is modified.
  144. #
  145. $(INCL)\date.h:     $(VOBJ) makedefs.ttp
  146.     .\makedefs -v
  147.  
  148. $(INCL)\trap.h:     makedefs.ttp
  149.     .\makedefs -t
  150.  
  151. $(INCL)\onames.h:  makedefs.ttp
  152.     .\makedefs -o
  153.  
  154. $(INCL)\pm.h:  makedefs.ttp
  155.     .\makedefs -p
  156.  
  157. data:    $(AUX)\data.base makedefs.ttp
  158.     .\makedefs -d
  159.  
  160. rumors: $(AUX)\rumors.tru $(AUX)\rumors.fal makedefs.ttp
  161.     .\makedefs -r
  162.  
  163. #
  164. #    The following programs vary depending on what OS you are using.
  165. #
  166. main.o:   $(HACK_H) $(PC)main.c
  167.     $(CC) -c $(CFLAGS) $(PC)main.c -o main.o
  168.  
  169. tty.o:   $(HACK_H) $(INCL)\func_tab.h $(PC)tty.c
  170.     $(CC) -c $(CFLAGS) $(PC)tty.c -o tty.o
  171.  
  172. unix.o:   $(HACK_H) $(PC)unix.c
  173.     $(CC) -c $(CFLAGS) $(PC)unix.c -o unix.o
  174.  
  175. #
  176. # GCC 1.35 has trouble with the construct
  177. #    for (x = ...) for(y = ...) levl[x][y].foo = stuff;
  178. # this happens in (at least) bones.c and shknam.c. So if you're using
  179. # 1.35, uncomment the following lines. The problem is fixed in 1.36.
  180. #
  181. #bones.o: $(HACK_H)
  182. #    $(CC) $(MODEL) $(WARN) -I$(INCL) -c bones.c
  183. #shknam.o: $(HACK_H) $(INCL)\eshk.h
  184. #    $(CC) $(MODEL) $(WARN) -I$(INCL) -c shknam.c
  185. #
  186. # Secondary targets
  187. #
  188.  
  189. AUXMISC = cmdhelp help hh history license opthelp oracles
  190.  
  191. auxil:    data rumors spec_levs
  192.     cd $(AUX)
  193.     cp data rumors $(GAMEDIR)
  194.     rm data rumors
  195.     cp $(AUXMISC) $(GAMEDIR)
  196.  
  197. spec_levs: $(AUX)\castle.des $(AUX)\endgame.des $(AUX)\tower.des
  198.     cd $(AUX)
  199.     ..\src\lev_comp castle.des
  200.     ..\src\lev_comp endgame.des
  201.     ..\src\lev_comp tower.des
  202.     cp castle endgame $(GAMEDIR)
  203.     rm castle endgame
  204.     cp tower1 tower2 tower3 $(GAMEDIR)
  205.     rm tower1 tower2 tower3
  206.  
  207. clean:
  208.     rm *.o
  209.  
  210. spotless: clean
  211.     cd $(INCL)
  212.     rm date.h
  213.     rm onames.h
  214.     rm pm.h
  215.     touch date.h onames.h pm.h
  216.     cd $(SRC)
  217.     rm makedefs.ttp
  218.     rm lev_comp.ttp
  219.  
  220. #
  221. # Other dependencies
  222. #
  223.  
  224. # GO AHEAD, DELETE THIS LINE
  225.  
  226. allmain.o: $(HACK_H)
  227. alloc.o:  $(CONFIG_H)
  228. apply.o:  $(HACK_H) $(INCL)\edog.h
  229. artifact.o:  $(HACK_H) $(INCL)\artifact.h
  230. attrib.o:  $(HACK_H)
  231. bones.o:  $(HACK_H)
  232. cmd.o:  $(HACK_H) $(INCL)\func_tab.h
  233. dbridge.o: $(HACK_H)
  234. decl.o:  $(HACK_H)
  235. demon.o:  $(HACK_H)
  236. do.o:  $(HACK_H)
  237. do_name.o:  $(HACK_H)
  238. do_wear.o:  $(HACK_H)
  239. dog.o:  $(HACK_H) $(INCL)\edog.h
  240. dogmove.o:  $(HACK_H) $(INCL)\mfndpos.h $(INCL)\edog.h
  241. dokick.o:  $(HACK_H) $(INCL)\eshk.h
  242. dothrow.o:  $(HACK_H)
  243. eat.o:  $(HACK_H)
  244. end.o:  $(HACK_H) $(INCL)\eshk.h
  245. engrave.o:  $(HACK_H)
  246. exper.o:  $(HACK_H)
  247. extralev.o:  $(HACK_H)
  248. fountain.o:  $(HACK_H)
  249. getline.o:  $(HACK_H) $(INCL)\func_tab.h
  250. hack.o:  $(HACK_H)
  251. invent.o:  $(HACK_H) $(INCL)\lev.h $(INCL)\wseg.h
  252. ioctl.o:  $(HACK_H)
  253. lock.o:  $(HACK_H)
  254. makemon.o:  $(HACK_H)
  255. mail.o:  $(HACK_H)
  256. mcastu.o:  $(HACK_H)
  257. mhitm.o:  $(HACK_H) $(INCL)\artifact.h
  258. mhitu.o:  $(HACK_H) $(INCL)\artifact.h $(INCL)\edog.h
  259. mklev.o:  $(HACK_H)
  260. mkmaze.o:  $(HACK_H)
  261. mkobj.o:  $(HACK_H)
  262. mkroom.o:  $(HACK_H)
  263. mon.o:  $(HACK_H) $(INCL)\mfndpos.h $(INCL)\wseg.h
  264. mondata.o:  $(HACK_H) $(INCL)\eshk.h $(INCL)\epri.h
  265. monmove.o:  $(HACK_H) $(INCL)\mfndpos.h $(INCL)\artifact.h
  266.  
  267. # kludge for "monst.c: Virtual memory exhausted" errors
  268. # we build monst.s in two pieces, then glue them together with
  269. # "sed". if you don't have memory problems, uncomment out
  270. # all but the line starting "monst.o:". if you don't have sed, get it from
  271. # a comp.binaries.atari.st site, or get gnu sed (the port to
  272. # the atari GCC is easy).
  273.  
  274. monst.o:  $(CONFIG_H) $(PERMONST_H) $(INCL)\eshk.h $(INCL)\vault.h $(INCL)\epri.h $(INCL)\color.h
  275.     $(CC) $(CFLAGS) -S -o monst1.s -DSPLITMON_1 monst.c
  276.     $(CC) $(CFLAGS) -S -o monst2.s -DSPLITMON_2 monst.c
  277.     sed -e s/LC/LD/ -e s/gcc_compiled.:// monst2.s >>monst1.s
  278.     $(CC) $(CFLAGS) -c monst1.s -o monst.o
  279.     rm monst1.s monst2.s
  280.  
  281. msdos.o:  $(HACK_H)
  282. mthrowu.o:  $(HACK_H)
  283. music.o:  $(HACK_H)
  284. o_init.o:  $(HACK_H) $(INCL)\onames.h
  285. objects.o:  $(CONFIG_H) $(INCL)\obj.h $(INCL)\objclass.h $(INCL)\prop.h $(INCL)\color.h
  286. objnam.o:  $(HACK_H)
  287. options.o:  $(HACK_H)
  288. pager.o:  $(HACK_H)
  289. panic.o:  $(CONFIG_H)
  290. pickup.o:  $(HACK_H)
  291. polyself.o:  $(HACK_H)
  292. potion.o:  $(HACK_H)
  293. pray.o:  $(HACK_H)
  294. pri.o:  $(HACK_H) $(INCL)\epri.h $(INCL)\termcap.h
  295. priest.o:  $(HACK_H) $(INCL)\mfndpos.h $(INCL)\eshk.h $(INCL)\epri.h
  296. prisym.o:  $(HACK_H) $(INCL)\lev.h $(INCL)\wseg.h
  297. random.o:
  298. read.o:  $(HACK_H)
  299. restore.o:  $(HACK_H) $(INCL)\lev.h $(INCL)\wseg.h
  300. rip.o:  $(HACK_H)
  301. rnd.o:  $(HACK_H)
  302. rumors.o:  $(HACK_H)
  303. save.o:  $(HACK_H) $(INCL)\lev.h $(INCL)\wseg.h
  304. search.o:  $(HACK_H) $(INCL)\artifact.h
  305. shk.o:  $(HACK_H) $(INCL)\eshk.h
  306. shknam.o:  $(HACK_H) $(INCL)\eshk.h
  307. sit.o:  $(HACK_H)
  308. sounds.o:  $(HACK_H) $(INCL)\edog.h $(INCL)\eshk.h
  309. sp_lev.o:  $(HACK_H) $(INCL)\sp_lev.h
  310. spell.o:  $(HACK_H)
  311. steal.o:  $(HACK_H)
  312. termcap.o:  $(HACK_H) $(INCL)\termcap.h
  313. timeout.o:  $(HACK_H)
  314. topl.o:  $(HACK_H)
  315. topten.o:  $(HACK_H)
  316. track.o:  $(HACK_H)
  317. trap.o:  $(HACK_H) $(INCL)\edog.h
  318. u_init.o:  $(HACK_H)
  319. uhitm.o:  $(HACK_H) $(INCL)\artifact.h
  320. vault.o:  $(HACK_H) $(INCL)\vault.h
  321. version.o:  $(HACK_H) $(INCL)\date.h $(INCL)\patchlevel.h
  322. weapon.o:  $(HACK_H)
  323. were.o:  $(HACK_H)
  324. wield.o:  $(HACK_H)
  325. wizard.o:  $(HACK_H)
  326. worm.o:  $(HACK_H) $(INCL)\wseg.h
  327. worn.o:  $(HACK_H)
  328. write.o:  $(HACK_H)
  329. zap.o:  $(HACK_H)
  330.